// pages/custom-tab-bar/index.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {

  },

  /**
   * 组件的初始数据
   */
  data: {
      selected:0,
      color:"#7A7E83",
      selectedColor:"#3cc51f",
      list:[{
        // 主页面
        pagePath: "/pages/MineClasses/MineClasses",
        iconPath: "/image/paiban_off.png",
        selectedIconPath: "/image/paiban_on.png",
        text: "排班"
      }, {
        //人员页面
        pagePath: "/pages/personalDetails/personalDetails",
        iconPath: "/image/renyuan_off.png",
        selectedIconPath: "/image/renyuan_on.png",
        text: "人员"
      },
      {
        pagePath: "/pages/MineClasses/MineClasses",
        iconPath: "/image/shuju_off.png",
        selectedIconPath: "/image/shuju_on.png",
        text: "数据"
      },
      {
        pagePath: "/pages/logs/logs",
        iconPath: "/image/dongtai_off.png",
        selectedIconPath: "/image/dongtai_on.png",
        text: "动态"
      },
    ]
  },

  /**
   * 组件的方法列表
   */
  methods: {
      switchTab(e){
        const data = e.currentTarget.dataset
        const url  = data.path
        wx.switchTab({
          url:url
        })
        this.setData({selected:data.index})
      }
  }
})
